<div id="addnew_transport"></div>
<div id="transports_table">
  <%= link_to 'Add New', new_transport_path, class: "btn btn-primary", remote: true %> <br/> <br/>
  <table class="table">
    <thead>
      <tr>
        <th>Primary Picture</th>
        <th>Description idn</th>
        <th>Description eng</th>
        <th style="text-align:center;">Status</th>
        <th style="text-align:center;" colspan="2">Option</th>
        <th style="text-align:center;">Action</th>
      </tr>
    </thead>
    <tbody id="transports">
      <% @transports.each do |transport| %>
        <tr>
          <td><%= transport.transport_name %><br/><%= image_tag transport.primary_picture.url(:thumb) if !transport.primary_picture.blank? %> </td>
          <td class="text-center"><%= transport.description_idn %></td>
          <td class="text-center"><%= transport.description_eng %></td>
          <td class="text-center">
            <span class="<%= (transport.is_published == false) ? raw('label label-important') : raw('label label-success') %>"><%= (transport.is_published == true) ? raw('Published') : raw('Not Published') %></span><br/> <br/>
            <span class="<%= (transport.is_on_promoted == false) ? raw('label label-important') : raw('label label-success') %>"><%= (transport.is_on_promoted == true) ? raw('Promoted') : raw('Not Promoted') %></span><br/> <br/>
            <span class="<%= (transport.is_recomended == false) ? raw('label label-important') : raw('label label-success') %>"><%= (transport.is_recomended == true) ? raw('Recomended') : raw('Not Recomended') %></span><br/> <br/>
          </td>
          <td class="text-center"><%= link_to "transport Package", transport_packages_path(:tsid => transport.id), remote: true %></td>
          <td class="text-center"><%= link_to "Images", transport_images_path(:tsid => transport.id), remote: true %></td> 
          <td class="text-center">
            <%= link_to 'Edit', edit_transport_path(transport), remote: true %> | 
            <%= link_to 'Delete', transport, method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <div class="collection_paginator">
    <%#= will_paginate transports %>
  </div>
</div>

<%= link_to 'New Transport', new_transport_path, remote: true %>
